package com.hellowx.qydcdev.webservice;

import com.hellowx.qydcdev.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

/**
 * Created on 2022/1/7.
 *
 * @author Hello WX
 */
@Slf4j
@WebService
@Component("goodsOrderWebService")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public class GoodsOrderWebServiceImpl implements GoodsOrderWebService{

    @Resource
    private OrderService orderService;

    @Override
    public Reply createOrder(String json) {
        long orderId = orderService.createOrder(json);
        if (orderId>0){
            return Reply.getReply(Reply.ErrorCode.SUCCESS.toString()).setMessage(String.valueOf(orderId));
        }
        return Reply.getReply(Reply.ErrorCode.FAILURE.toString());
    }
}
